package com.example.ipcdemo;

import android.util.Log;

import com.example.ipcdemo.bean.UserInfo;

public class UserSingleton implements IUserSingleton {


    private static UserSingleton mInstance;

    public static UserSingleton getInstance(String name) {
        Log.e("UserSingleton", "服务获取成功 name:" + name);
        if (mInstance == null) {
            mInstance = new UserSingleton();
        }
        return mInstance;
    }


    private UserInfo info;

    public void setInfo(UserInfo info) {
        this.info = info;
    }

    @Override
    public UserInfo getUserInfo() {
        return info;
    }

    @Override
    public void setUserName(String name) {
        info.setName(name);
    }

    @Override
    public String getUserName() {
        return info.getName();
    }
}
